<!-- 公告详情 -->
<template>
  <div class="newscontent">
    <van-row>
      <p class="title">{{newsData.title}}</p>
      <p class="atm">{{common.formatDate(newsData.addTime)}}</p>
    </van-row>
    <van-row>
      <p class="content" v-html="newsData.content"></p>
    </van-row>
    <van-row v-if="newsData.picUrl !== ''">
      <div class="box-img">
        <img :src="newsData.picUrl">
      </div>

    </van-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      newsData: {},
    }
  },
  methods: {
    //获取用户信息
    async getDetail () {
      let id = this.$route.query.id
      const url = `/article/get/${id}`
      let result = await this.request.mobileRequest('GET', url)
      if (result.code == 200) {
        this.newsData = result.data
        console.log(this.newsData);

      } else {
        this.$notify({ type: 'warning', message: result.msg });
      }
    },

  },
  mounted () {
    this.getDetail();
  }
}
</script>

<style scoped>
.newscontent {
  padding: 0.2rem;
  box-sizing: border-box;
  background-color: #fff;
}
.title {
  font-size: 0.38rem;
  padding: 0.2rem 0;
}
.atm {
  font-size: 0.2rem;
  border-bottom: 1px solid #ccc;
}
.content {
  padding-top: 0.5rem;
}
.box-img {
  padding: 0.5rem 0;
}
img {
  width: 100%;
  border-radius: 0.1rem;
}
</style>
